<template>
    <div>
        <button>返回</button>
        <span>{{ myTitle }}</span>
        <button>前进</button>
    </div>
</template>

<script>
import store from './store';

export default {
    data() {
        return {
            myTitle: "默认标题"
        }
    },
    mounted() {
        //订阅
        store.subscribe((value) => {
            console.log("我被触发了", value);
            this.myTitle = value
        })
    }
}
</script>

<style scoped>
div {
    display: flex;
    width: 100%;
    justify-content: space-between;
    height: 50px;
    line-height: 50px;
    background: pink;
}
</style>